package cn.ekuma.epos.analysis.singleproduct;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import cn.ekuma.epos.businesslogic.OrderUtil;

import com.openbravo.bean.erp.viewbean.ProductTransaction;

public class SingleProductAnalysis {
   private Date curDate;
   private Map<String,Double> orderNum;
   private double total;
   
   public SingleProductAnalysis() {
	   orderNum=new HashMap<String,Double>();
	   total=0;
   }

public void addProductTransaction(ProductTransaction productTransaction){
	  String realOrderName;
      realOrderName=productTransaction.getOrderTypeName()+"("+(productTransaction.getOrderType()==0?OrderUtil.ORDERTYPE_Normal:OrderUtil.ORDERTYPE_Revoerse)+")";
      if(orderNum.containsKey(realOrderName))
           orderNum.put(realOrderName, orderNum.get(realOrderName)+productTransaction.getMultiply());
      else
    	  orderNum.put(realOrderName, productTransaction.getMultiply());
}


public Date getCurDate() {
	return curDate;
}



public void setCurDate(Date curDate) {
	this.curDate = curDate;
}



public Map<String, Double> getOrderNum() {
	return orderNum;
}


public Double getTransaxtion(String orderType) {
	return orderNum.get(orderType);
}

}
